*Intellectualism, Anti-Intellectualism, and Epistemic Hubris in Red and Blue America
*THE AMERICAN POLITICAL SCIENCE REVIEW
*David C. Barker, Ryan DeTamble, and Morgan Marietta
*Replication Code
*7/28/2021



******************************

*Creation of Needed Variables*

******************************

gen hubrisdebtpre = 1 if AMU362==0

replace hubrisdebtpre = 1 if AMU362==4

replace hubrisdebtpre = 0 if AMU362==1

replace hubrisdebtpre = 0 if AMU362==2

replace hubrisdebtpre = 0 if AMU362==3

sum hubrisdebtpre

tab hubrisdebtpre



gen hubrisimmigpre = 1 if AMU364==0

replace hubrisimmigpre = 1 if AMU364==4

replace hubrisimmigpre = 0 if AMU364==1

replace hubrisimmigpre = 0 if AMU364==2

replace hubrisimmigpre = 0 if AMU364==3

sum hubrisimmigpre

tab hubrisimmigpre



gen hubrisgunspre = 1 if AMU365==0

replace hubrisgunspre = 1 if AMU365==4

replace hubrisgunspre = 0 if AMU365==1

replace hubrisgunspre = 0 if AMU365==2

replace hubrisgunspre = 0 if AMU365==3

sum hubrisgunspre

tab hubrisgunspre



gen hubrisminwagepre = 1 if AMU366==0

replace hubrisminwagepre = 1 if AMU366==4

replace hubrisminwagepre = 0 if AMU366==1

replace hubrisminwagepre = 0 if AMU366==2

replace hubrisminwagepre = 0 if AMU366==3

sum hubrisminwagepre

tab hubrisminwagepre



gen hubrishcpre = 1 if AMU367==0

replace hubrishcpre = 1 if AMU367==4

replace hubrishcpre = 0 if AMU367==1

replace hubrishcpre = 0 if AMU367==2

replace hubrishcpre = 0 if AMU367==3

sum hubrishcpre

tab hubrishcpre



gen hubrischarterpre = 1 if AMU368==0

replace hubrischarterpre = 1 if AMU368==4

replace hubrischarterpre = 0 if AMU368==1

replace hubrischarterpre = 0 if AMU368==2

replace hubrischarterpre = 0 if AMU368==3

sum hubrischarterpre

tab hubrischarterpre



gen hubrislifepre = 1 if AMU369==0

replace hubrislifepre = 1 if AMU369==4

replace hubrislifepre = 0 if AMU369==1

replace hubrislifepre = 0 if AMU369==2

replace hubrislifepre = 0 if AMU369==3

sum hubrislifepre

tab hubrislifepre



gen hubriscollegefreepre = 1 if AMU371==0

replace hubriscollegefreepre = 1 if AMU371==4

replace hubriscollegefreepre = 0 if AMU371==1

replace hubriscollegefreepre = 0 if AMU371==2

replace hubriscollegefreepre = 0 if AMU371==3

sum hubriscollegefreepre

tab hubriscollegefreepre



gen hubrisgritpre = 1 if AMU372==0

replace hubrisgritpre = 1 if AMU372==4

replace hubrisgritpre = 0 if AMU372==1

replace hubrisgritpre = 0 if AMU372==2

replace hubrisgritpre = 0 if AMU372==3

sum hubrisgritpre

tab hubrisgritpre



gen white = 1 if race==1

replace white = 0 if race>1

sum white 

tab white



gen nerd = 1 if AMU342==1

replace nerd = 0 if AMU342>1

sum nerd

tab nerd



gen female = 1 if female2==2

replace female = 0 if female2==1

sum female

tab female



gen educ601 = 0 if educ==1

replace educ601 = .2 if educ==2

replace educ601 = .4 if educ==3

replace educ601 = .6 if educ==4

replace educ601 = .8 if educ==5

replace educ601 = 1 if educ==6

sum educ601

tab educ601



gen readingweekend = 1 if AMU343==1

replace readingweekend = 0 if AMU343>1

sum readingweekend

tab readingweekend



gen pid3leangophi01 = .5 if pid7==4

replace pid3leangophi01 = 0 if pid7<4

replace pid3leangophi01 = 1 if pid7>4

sum pid3leangophi01

tab pid3leangophi01



gen bornagain = 1 if pew_bornagain==1

replace bornagain = 0 if pew_bornagain==2

sum bornagain

tab bornagain



gen churchatt601 = 1 if pew_churatd==1

replace churchatt601 = .8 if pew_churatd==2

replace churchatt601 = .6 if pew_churatd==3

replace churchatt601 = .4 if pew_churatd==4

replace churchatt601 = .2 if pew_churatd==5

replace churchatt601 = 0 if pew_churatd>5

sum churchatt601

tab churchatt601



gen artinterest01 = 1 if AMU305==4

replace artinterest01 = .75 if AMU305==3

replace artinterest01 = .5 if AMU305==2

replace artinterest01 = .25 if AMU305==1

replace artinterest01 = 0 if AMU305==0

sum artinterest01

tab artinterest01



gen activeimag01 = 1 if AMU310==0

replace activeimag01 = .75 if AMU310==1

replace activeimag01 = .5 if AMU310==2

replace activeimag01 = .25 if AMU310==3

replace activeimag01 = 0 if AMU310==4

sum activeimag01

tab activeimag01



gen notnervous501 = 1 if AMU309==4

replace notnervous501 = .75 if AMU309==3

replace notnervous501 = .5 if AMU309==2

replace notnervous501 = .25 if AMU309==1

replace notnervous501 = 0 if AMU309==0

sum notnervous501

tab notnervous501



gen newspaprlast24 = 1 if CC20_300_3==1

replace newspaprlast24 = 0 if CC20_300_3==2

sum newspaprlast24

tab newspaprlast24



gen tvnewspast24 = 1 if CC20_300_2==1

replace tvnewspast24 = 0 if CC20_300_2==2

sum tvnewspast24

tab tvnewspast24



gen radionewspast24 = 1 if CC20_300_4==1

replace radionewspast24 = 0 if CC20_300_4==2

sum radionewspast24

tab radionewspast24



gen bibleinerrantdic = 0

replace bibleinerrantdic = 1 if AMU349==1

sum bibleinerrantdic

tab bibleinerrantdic



gen popriggedpowerful = 1 if AMU321==4

replace popriggedpowerful = .75 if AMU321==3

replace popriggedpowerful = .5 if AMU321==2

replace popriggedpowerful = .25 if AMU321==1

replace popriggedpowerful = 0 if AMU321==0

sum popriggedpowerful

tab popriggedpowerful



gen poppeoplemakedecid = 1 if AMU322==4

replace poppeoplemakedecid = .75 if AMU322==3

replace poppeoplemakedecid = .5 if AMU322==2

replace poppeoplemakedecid = .25 if AMU322==1

replace poppeoplemakedecid = 0 if AMU322==0

sum poppeoplemakedecid

tab poppeoplemakedecid



gen popsecretcabal = 1 if AMU338==4

replace popsecretcabal = .75 if AMU338==3

replace popsecretcabal = .5 if AMU338==2

replace popsecretcabal = .25 if AMU338==1

replace popsecretcabal = 0 if AMU338==0

sum popsecretcabal

tab popsecretcabal



gen ideo501 = ideo5-1

replace ideo501 = ideo501/4

sum ideo501


gen ideologuedic = 0

replace ideologuedic = 1 if ideo5==4

replace ideologuedic = 1 if ideo5==1

sum ideologuedic

tab ideologuedic



gen partisanintensdic = 0

replace partisanintensdic = 1 if pid7==1

replace partisanintensdic = 1 if pid7==7

sum partisanintensdic

tab partisanintensdic



gen age01 = birthyr-1929
replace age01=age01/73
replace age01=age01*-1
replace age01=age01+1

sum age01

tab age01

gen faminc_newmisslist = faminc_new

replace faminc_newmisslist = . if faminc_new >=17

impute faminc_newmisslist educ601 white female age01, generate (famincnewimputed01new)

sum famincnewimputed01new

replace famincnewimputed01new= famincnewimputed01new-1

replace famincnewimputed01new= famincnewimputed01new /15

tab famincnewimputed01new

************

*Hubris PCA*

************

pca hubrisimmigpre hubrisgunspre hubrisminwagepre hubrischarterpre hubrislifepre hubriscollegefreepre hubrisgritpre hubrisdebtpre hubrishcpre

predict hubrispca9

sum hubrispca9

gen hubrispca901 = hubrispca9+2.348723

sum hubrispca901

replace hubrispca901 = hubrispca901/6.277135

sum hubrispca901

alpha hubrisimmigpre hubrisgunspre hubrisminwagepre hubrischarterpre hubrislifepre hubriscollegefreepre hubrisgritpre hubrisdebtpre hubrishcpre

reg hubrispca901 notnervous501


predict hubrisprepca9_residnotnerv, residuals

sum hubrisprepca9_residnotnerv

replace hubrisprepca9_residnotnerv= hubrisprepca9_residnotnerv+.4313117

sum hubrisprepca9_residnotnerv

replace hubrisprepca9_residnotnerv= hubrisprepca9_residnotnerv/ 1.113143

sum hubrisprepca9_residnotnerv

***************************

*Intellectual Identity PCA*

*(but have to create news attentiveness PCA first to include it in Intellectual Identity PCA)*

***************************

pca newspaprlast24 tvnewspast24 radionewspast24

predict newslast24pca3

sum newslast24pca3

gen newslast24pca301 = newslast24pca3+1.447922 

sum newslast24pca301

replace newslast24pca301 = newslast24pca301/3.624943

sum newslast24pca301

********************************************************************************

*Intellectual Identity PCA that is used in the article and is discussed in the in-text measurement appendix*

********************************************************************************

pca intelloccup2 intellectualmajor newslast24pca301 nerd readingweekend artinterest01 activeimag01

predict intelpca7media24

sum intelpca7media24

gen intelpca7media2401 = intelpca7media24+2.562494

sum intelpca7media2401

replace intelpca7media2401 = intelpca7media2401/6.500291

sum intelpca7media2401

alpha intelloccup2 intellectualmajor newslast24pca301 nerd readingweekend artinterest01 activeimag01



***********************

*Anti-Intellectual PCA*

***********************

pca AMU331 AMU332 AMU333 AMU334 AMU335

predict antiintelpca5

sum antiintelpca5

gen antiintelpca501 = antiintelpca5+3.319622

sum antiintelpca501

replace antiintelpca501 = antiintelpca501/6.917842

sum antiintelpca501

alpha AMU331 AMU332 AMU333 AMU334 AMU335

******************************

*Creating 3 point variables of intellectual ID and anti-intellectual affect*

******************************

gen intelpca7med3pt= 0 if intelpca7media2401 <=.4
replace intelpca7med3pt= .5 if intelpca7media2401 >=.40001 & intelpca7media2401 <=.5999
replace intelpca7med3pt= 1 if intelpca7media2401 >=.6

gen antiintelpca53pt = 0 if antiintelpca501 <=.4

replace antiintelpca53pt = .5 if antiintelpca501 >=.400001 &  antiintelpca501 <=.599999999
replace antiintelpca53pt = 1 if antiintelpca501 >=.6 


*****************************

*Cross-tab of 3 point intellectual identity and affect

******************************

tab intelpca7med3pt antiintelpca53pt, column row cell chi2


******************************

*Christian Traditionalism PCA*

******************************

pca bibleinerrantdic bornagain churchatt601

predict tradchristpca3

sum tradchristpca3

gen tradchristpca301 = tradchristpca3+1.260615

sum tradchristpca301

replace tradchristpca301 = tradchristpca301/4.300384

sum tradchristpca301

**********************

*Generic Populism PCA*

**********************

pca popriggedpowerful poppeoplemakedecid popsecretcabal

predict genpopulismpca3 

sum genpopulismpca3

gen genpopulismpca301 = genpopulismpca3+4.10685

sum genpopulismpca301

replace genpopulismpca301 = genpopulismpca301/6.28994

sum genpopulismpca301

**********************

*Authoritarianism PCA*

**********************

pca AMU317 AMU320A AMU320B

predict authorpca3nocurio 

sum authorpca3nocurio

gen authorpca3nocurio1 = authorpca3nocurio+2.201052

sum authorpca3nocurio1

replace authorpca3nocurio1 = authorpca3nocurio1/4.441835

sum authorpca3nocurio1



**************************************************************************

*First set of regression equations, predicting hubris- simple model specifications*

**************************************************************************

reg hubrisprepca9_residnotnerv intelpca7media2401 white female age01 famincnewimputed01new 

vif

reg hubrisprepca9_residnotnerv antiintelpca501 white female age01 famincnewimputed01new 

vif

reg hubrisprepca9_residnotnerv intelpca7media2401 antiintelpca501 white female age01 famincnewimputed01new 

vif

gen intelpcamedia24Xantiintelpca501 = intelpca7media2401*antiintelpca501

reg hubrisprepca9_residnotnerv intelpca7media2401 antiintelpca501 intelpcamedia24Xantiintelpca501 white female age01 famincnewimputed01new 

vif


*****************************************************************************

*Second set of regression equations, predicting hubris with the fuller model specifications*

*****************************************************************************

reg hubrisprepca9_residnotnerv intelpca7media2401 white female age01 famincnewimputed01new educ601 collegeelitism tradchristpca301 ideo501 genpopulismpca301 partisanintensdic ideologuedic authorpca3nocurio1

vif


reg hubrisprepca9_residnotnerv  antiintelpca501  white female age01 famincnewimputed01new educ601 collegeelitism tradchristpca301 ideo501 genpopulismpca301 partisanintensdic ideologuedic authorpca3nocurio1

vif 


reg hubrisprepca9_residnotnerv intelpca7media2401 antiintelpca501  white female age01 famincnewimputed01new educ601 collegeelitism tradchristpca301 ideo501 genpopulismpca301 partisanintensdic ideologuedic authorpca3nocurio1

vif

reg hubrisprepca9_residnotnerv intelpca7media2401 antiintelpca501 intelpcamedia24Xantiintelpca501  white female age01 famincnewimputed01new educ601 collegeelitism tradchristpca301 ideo501 genpopulismpca301 partisanintensdic ideologuedic authorpca3nocurio1

vif

********************************************************************************

*Now the mlogit models predicting PID, followed by the margins re-estimation*

********************************************************************************

mlogit pid3leangophi01 intelpca7media2401  white female age01 famincnewimputed01 educ601 tradchristpca301

margins, dydx (*)



mlogit pid3leangophi01 antiintelpca501 white female age01 famincnewimputed01 educ601 tradchristpca301 

margins, dydx (*)



mlogit pid3leangophi01 intelpca7media2401 antiintelpca501 white female age01 famincnewimputed01 educ601 tradchristpca301 

margins, dydx (*)



mlogit pid3leangophi01 intelpca7media2401 antiintelpca501 intelpcamedia24Xantiintelpca501 white female age01 famincnewimputed01 educ601 tradchristpca301 

margins, dydx (*)


********************************************************************************

*Now using the 3 point measures and no other covariates, followed by the within-party crosstab, to calculate the numbers in the final 2X2 table, 

********************************************************************************
 
 mlogit pid3leangophi01 intelpca7med3pt antiintelpca53pt
 
prvalue, x (intelpca7med3pt=0 antiintelpca53pt=0)
prvalue, x (intelpca7med3pt=1 antiintelpca53pt=0)
prvalue, x (intelpca7med3pt=0 antiintelpca53pt=1)
prvalue, x (intelpca7med3pt=1 antiintelpca53pt=1)


bysort pid3leangophi01: tab intelpca7med3pt antiintelpca53pt, column row cell chi2


************************************

*Everything for main paper complete*

************************************



*************************************************************************

*Now here is a replication of everything above, using the 9 item index of intellectual identity that includes the two education varibles as discussed in Footnote 29 on Page 27*

*************************************************************************



*****************************************

*New intellectual identity PCA here! (The one that produces intelpca901newer) as discussed in Footnote 29 on Page 27*

*****************************************

pca educ601 nerd readingweekend intelloccup2 intellectualmajor artinterest01 activeimag01 collegeelitism newslast24pca301

predict intelpca9newer

sum intelpca9newer

gen intelpca901newer = intelpca9newer+2.550714

sum intelpca901newer

replace intelpca901newer = intelpca901newer/6.756734

sum intelpca901newer

*******************

*Regression Models*

*******************

reg hubrisprepca9_residnotnerv intelpca901newer  white female age01 famincnewimputed01new 

reg hubrisprepca9_residnotnerv antiintelpca501 white female age01 famincnewimputed01new 

reg hubrisprepca9_residnotnerv intelpca901newer antiintelpca501 white female age01 famincnewimputed01new 

gen intelpca9newerXantiintelpca501 = intelpca901newer*antiintelpca501

reg hubrisprepca9_residnotnerv intelpca901newer antiintelpca501 intelpca9newerXantiintelpca501 white female age01 famincnewimputed01new 



********************************

*Now the fully specified models*

********************************

reg hubrisprepca9_residnotnerv intelpca901newer white female age01 famincnewimputed01new tradchristpca301 ideo501 genpopulismpca301 partisanintensdic ideologuedic authorpca3nocurio1

reg hubrisprepca9_residnotnerv intelpca901newer antiintelpca501 white female age01 famincnewimputed01new tradchristpca301 ideo501 genpopulismpca301 partisanintensdic ideologuedic authorpca3nocurio1

reg hubrisprepca9_residnotnerv intelpca901newer antiintelpca501 intelpca9newerXantiintelpca501 white female age01 famincnewimputed01new tradchristpca301 ideo501 genpopulismpca301 partisanintensdic ideologuedic authorpca3nocurio1



***************************************************************************

*Now the pid mlogit with the fuller measure of intel ID (with the education indicators included)*

***************************************************************************

mlogit pid3leangophi01 intelpca901newer  white female age01 famincnewimputed01 tradchristpca301

margins, dydx (*)



mlogit pid3leangophi01 intelpca901newer antiintelpca501  white female age01 famincnewimputed01 tradchristpca301 

margins, dydx (*)



mlogit pid3leangophi01 intelpca901newer antiintelpca501 intelpca9newerXantiintelpca501  white female age01 famincnewimputed01 tradchristpca301 

margins, dydx (*)


*****************************

*2020 intrapartisan analysis*

*****************************

gen intelpca7mediaXpid3lean01 = intelpca7media2401*pid3leangophi01

gen antiintelpca501Xpid3leangophi01 = antiintelpca501*pid3leangophi01

reg hubrisprepca9_residnotnerv pid3leangophi01 intelpca7media2401 intelpca7mediaXpid3lean01 antiintelpca501 white female age01 famincnewimputed01new

reg hubrisprepca9_residnotnerv pid3leangophi01 antiintelpca501 antiintelpca501Xpid3leangophi01 intelpca7media2401 white female age01 famincnewimputed01new

reg hubrisprepca9_residnotnerv pid3leangophi01 intelpca7media2401 intelpca7mediaXpid3lean01 antiintelpca501 white female age01 famincnewimputed01new educ601 collegeelitism tradchristpca301 ideo501 genpopulismpca301 partisanintensdic ideologuedic authorpca3nocurio1

reg hubrisprepca9_residnotnerv pid3leangophi01 antiintelpca501 antiintelpca501Xpid3leangophi01 intelpca7media2401 white female age01 famincnewimputed01new educ601 collegeelitism tradchristpca301 ideo501 genpopulismpca301 partisanintensdic ideologuedic authorpca3nocurio1

******************************************************************************

*Now repeat but with education variables in the intellectual identity measure*

******************************************************************************

gen intelpca9newerXpid301 = intelpca901newer*pid3leangophi01

reg hubrisprepca9_residnotnerv pid3leangophi01 intelpca901newer intelpca9newerXpid301 antiintelpca501 white female age01  famincnewimputed01new 

reg hubrisprepca9_residnotnerv pid3leangophi01 intelpca901newer intelpca9newerXpid301 antiintelpca501 white female age01 famincnewimputed01new tradchristpca301 ideo501 genpopulismpca301 partisanintensdic ideologuedic authorpca3nocurio1
























